module Mm2s5Common
  def icon?(node)
    node.nil? ? false : node.name == "icon"
  end

  def stop_icon?(node)
    icon?(node) && node.attributes['BUILTIN'].to_s == "stop"
  end

  def first_icon?(node)
    icon?(node) && node.attributes['BUILTIN'].to_s == "full-1"
  end
  
  def pencil_icon?(node)
    icon?(node) && node.attributes['BUILTIN'].to_s == "pencil"
  end
  
  def button_cancel_icon?(node)
    icon?(node) && node.attributes['BUILTIN'].to_s == "button_cancel"
  end
  
  def first_child(node)
    if node.has_elements? 
      node.each_element { |e| return e}
    else
      return nil
    end   
  end
end
